<template>
    <div class="content">
        <div style="margin-top: 40px;">富文本输入内容</div>
        <el-form style="margin-top: 20px;" ref="form" :model="formModel" label-width="100px" label-position='top'>
            <el-form-item label="" prop="name">
                <Editor v-model="formModel.longtext" :height="500" />
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import {tools} from '@/utils/tools.js'
    import Editor from '@/components/Editor';
    export default {
        components: {
            Editor
        },
        props:{
            formModel:{
                type: Object,
                default: res=>{}
            }
        },
        data() {
            return {
                longtext: '',
            }
        },
        created(){

        },
        methods:{
            //子组件校验，传递到父组件
            validateForm () {
                let flag = false
                this.$refs['form'].validate(valid => {
                    if (valid) {
                        flag = true
                    } else {
                        flag = false
                    }
                })
                return flag
            },
        }
    }
</script>